import { getToken, setToken, delToken } from '@/utils/storage'
export default {
  namespaced: true,
  state () {
    return {
      token: getToken()
    }
  },
  mutations: {
    setUserToken (state, token) {
      // 给数据库的token赋值w
      state.token = token
      // 将token存到本地
      setToken(token)
    },
    logout (state) {
      state.token = ''
      delToken()
    }
  }
}
